package com.ruicar.afs.cloud.workflow.greatwall.processor;

import com.ruicar.afs.cloud.common.core.enums.AfsEnumUtil;
import com.ruicar.afs.cloud.workflow.greatwall.dto.GwtRequest;
import com.ruicar.afs.cloud.workflow.greatwall.enums.GwtMsgType;
import com.ruicar.afs.cloud.workflow.greatwall.enums.GwtObjectCode;

import java.text.MessageFormat;

public interface GwfObjectCodeProcessor extends BaseProcessor {
    GwtMsgType belongMsg();

    GwtObjectCode objectCode();

    default String processKey() {
        return MessageFormat.format("{0}-{1}", AfsEnumUtil.key(belongMsg()), AfsEnumUtil.key(objectCode()));
    }

    String process(GwtRequest request);

    default boolean processError(GwtRequest request) {
        return true;
    }
}
